package com.huawei.register.service.impl;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huawei.register.dao.UserInfoDao;
import com.huawei.register.pojo.UserInfo;
import com.huawei.register.service.UserInfoService;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoDao, UserInfo> implements UserInfoService {

    @Override
    public List<UserInfo> getUserInfo(String userName) {
        return list();
    }

    @Override
    public boolean addUser(UserInfo userInfo) {
        return save(userInfo);
    }

    @Override
    public IPage<UserInfo> selectUserByPage(int currentPage) {
        return page(new Page<>(currentPage, 5), null);
    }

    @Override
    public List<UserInfo> selectAllUserInfo() {
        return list(null);
    }
}
